package com.yyb.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
 * 
 * 
 */
@Data
@Schema(title = "RouterVO", description = "菜单路由的出参")
public class RouterVO {

    @Schema(title = "路由名称")
    private String name;

    @Schema(title = "路由地址")
    private String path;

    @Schema(title = "组件地址")
    private String component;

    @Schema(title = "是否在面包屑导航中点击")
    private String redirect;

    @Schema(title = "是否隐藏")
    private boolean hidden;

    @Schema(title = "是否一直显示")
    private boolean alwaysShow;

    @Schema(title = "MetaVO",description = "路由的元信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private MetaVO meta;


    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<RouterVO> children = new ArrayList<>();
    /**
     * 路由的元信息
     */
    @Data
    @Schema(title = "MetaVO", description = "路由的元信息")
    public static class MetaVO implements Serializable {
        @Schema(title = "菜单名称")
        private String title;
        @Schema(title = "菜单图标")
        private String icon;

        public MetaVO(String title, String icon) {
            this.title = title;
            this.icon = icon;
        }
    }
}
